/*
 * SetDataChange.java - Copyright Mar 14, 2012 Z Networks Group, Inc. All rights reserved.
 * Z Networks Group PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.andromeda.skadi.sandbox2;

import com.andromeda.skadi.data.DataChange;
import java.io.Serializable;

/**
 *
 * @author Dickinson Roman Arismendy Torres
 */
public class SetValueDataChange<T extends Serializable> implements DataChange<T> {

    private T newValue;

    public SetValueDataChange(T newValue) {
        this.newValue = newValue;
    }

    @Override
    public T apply(T original) {
        return getNewValue();
    }

    public T getNewValue() {
        return newValue;
    }

    @Override
    public T preview() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
